#include<bits/stdc++.h>

using namespace std;

//桶排序 适合关键字范围已知
int main() {
    int a[] = {1, 1, 6, 3, 3};
    int n = sizeof(a) / sizeof(a[0]);
    int b[10];//b[0] b[1]...b[9]
    memset(b, 0, sizeof(b));
    for (int i = 0; i < n; i++) {
        b[a[i]]++;

    }
    for (int i = 0; i <= 9; i++) {
        while (b[i]--) {
            cout << i << " ";
        }
    }

    return 0;
}
